Skip to content

Sync upstream v11.3.0 (merge conflicts) - #230

Open
JOY (JOY) wants to merge 37 commits into
mainfrom
sync-upstream-v11.3.0
Open

Sync upstream v11.3.0 (merge conflicts)#230
JOY (JOY) wants to merge 37 commits into
mainfrom
sync-upstream-v11.3.0

Conversation

@JOY

@JOY JOY (JOY) commented Sep 10, 2026

Copy link
Copy Markdown

Upstream Sync - v11.3.0

Auto-merge with upstream v11.3.0 failed. Version/workflow conflicts were auto-resolved,
but the following files have code conflicts that need manual resolution:

docker-compose/envs/common-blockscout.env
mix.lock

To resolve:

  1. Check out this branch locally
  2. Resolve remaining conflicts
  3. Push and merge this PR
  4. Then create tag v11.3.0 to trigger Docker build

Upstream release notes


Note

High Risk
Wide-ranging changes to caching, DB/query patterns, stats API shape, and JSON-RPC batching affect core API/indexer behavior; deploys need new env vars and counter backfill migrators.

Overview
Release 11.3.0 brings a large performance and caching overhaul plus OP Stack and JSON-RPC fixes, documented in CHANGELOG.md with many new tunables (DB prepare mode, address/token counter consolidation, cache propagation, migrations).

Counters & API behavior: Address and token transaction/holder/gas counters move from periodic full recomputation to incremental consolidation (AddressCounters / TokenCounters and consolidators, backfill migrators). Address counter endpoints read from cache instead of denormalized address columns. Total chain gas used is dropped from v2 stats, chain dashboard, and the GasUsageSum cache.

Query/preload path: Chain.preload_address_participants/4 deduplicates loading of from/to/contract (and token-transfer) address metadata across list endpoints, main page, websockets, and v1 token transfers. join_associations/2 is reworked so to-many associations are not join-limited (fixes short pages for uncle blocks and similar). Several flows use Address.check_address_exists and hash-based coin balance queries to avoid heavy address loads.

OP Stack & JSON-RPC: Post-exec txs (0x7D) get parser defaults and UI/API types; L1 attributes (0x7E, index 0) are labeled on Optimism. HTTP transport splits JSON-RPC batches by mapped URL type (responses matched by id). eth_getBalance accepts hex block numbers.

Other: Cache propagation runs via Explorer.Chain.Cache.Propagator; token-transfer realtime broadcasts skip work when nothing is subscribed (v1/v2 split). CryptoCompare API key support. Scam-address ETS cache. Removes gas-usage dashboard tooltip CSS.

Note: PR description still flags manual merge conflicts in docker-compose/envs/common-blockscout.env and mix.lock—not visible in the excerpted diff.

Reviewed by Cursor Bugbot for commit 6017d02. Configure here.

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…cout#14654)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…4761)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…#14764)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Victor Baranov <baranov.viktor.27@gmail.com>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
dependabot Bot and others added 6 commits September 9, 2026 14:44
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Victor Baranov <baranov.viktor.27@gmail.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@coderabbitai

coderabbitai Bot commented Sep 10, 2026

Copy link
Copy Markdown

Important

Review skipped

Too many files!

This PR contains 127 files, which is 27 over the limit of 100.

To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch.

Upgrade to a paid plan to raise the limit.

This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 333f05e7-ec5c-4a0e-bd61-24c6ba6e77ef

📥 Commits

Reviewing files that changed from the base of the PR and between fe40079 and 6017d02.

⛔ Files ignored due to path filters (1)
  • mix.lock is excluded by !**/*.lock
📒 Files selected for processing (127)
  • CHANGELOG.md
  • apps/block_scout_web/assets/css/components/_custom_tooltips.scss
  • apps/block_scout_web/lib/block_scout_web/controllers/address_coin_balance_controller.ex
  • apps/block_scout_web/lib/block_scout_web/controllers/address_controller.ex
  • apps/block_scout_web/lib/block_scout_web/controllers/api/v2/address_controller.ex
  • apps/block_scout_web/lib/block_scout_web/controllers/api/v2/fallback_controller.ex
  • apps/block_scout_web/lib/block_scout_web/controllers/api/v2/main_page_controller.ex
  • apps/block_scout_web/lib/block_scout_web/controllers/api/v2/stats_controller.ex
  • apps/block_scout_web/lib/block_scout_web/controllers/api/v2/token_controller.ex
  • apps/block_scout_web/lib/block_scout_web/controllers/api/v2/transaction_controller.ex
  • apps/block_scout_web/lib/block_scout_web/controllers/chain_controller.ex
  • apps/block_scout_web/lib/block_scout_web/controllers/tokens/token_controller.ex
  • apps/block_scout_web/lib/block_scout_web/controllers/tokens/transfer_controller.ex
  • apps/block_scout_web/lib/block_scout_web/graphql/resolvers/internal_transaction.ex
  • apps/block_scout_web/lib/block_scout_web/microservice_interfaces/transaction_interpretation.ex
  • apps/block_scout_web/lib/block_scout_web/notifier.ex
  • apps/block_scout_web/lib/block_scout_web/schemas/api/v2/stats/response.ex
  • apps/block_scout_web/lib/block_scout_web/templates/chain/show.html.eex
  • apps/block_scout_web/lib/block_scout_web/views/api/v2/transaction_view.ex
  • apps/block_scout_web/lib/block_scout_web/views/transaction_view.ex
  • apps/block_scout_web/mix.exs
  • apps/block_scout_web/priv/gettext/default.pot
  • apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po
  • apps/block_scout_web/test/block_scout_web/controllers/api/rpc/eth_controller_test.exs
  • apps/block_scout_web/test/block_scout_web/controllers/api/v2/address_controller_test.exs
  • apps/block_scout_web/test/block_scout_web/controllers/api/v2/block_controller_test.exs
  • apps/block_scout_web/test/block_scout_web/controllers/api/v2/stats_controller_test.exs
  • apps/block_scout_web/test/block_scout_web/controllers/api/v2/token_controller_test.exs
  • apps/block_scout_web/test/block_scout_web/controllers/api/v2/transaction_controller_test.exs
  • apps/block_scout_web/test/block_scout_web/views/api/v2/transaction_view_test.exs
  • apps/block_scout_web/test/block_scout_web/views/transaction_view_test.exs
  • apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/http.ex
  • apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/request_coordinator.ex
  • apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/transaction.ex
  • apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/transport.ex
  • apps/ethereum_jsonrpc/mix.exs
  • apps/ethereum_jsonrpc/test/ethereum_jsonrpc/http/mox_test.exs
  • apps/ethereum_jsonrpc/test/ethereum_jsonrpc/receipt_test.exs
  • apps/ethereum_jsonrpc/test/ethereum_jsonrpc/transaction_test.exs
  • apps/explorer/config/config.exs
  • apps/explorer/config/runtime/test.exs
  • apps/explorer/lib/explorer/application.ex
  • apps/explorer/lib/explorer/chain.ex
  • apps/explorer/lib/explorer/chain/address.ex
  • apps/explorer/lib/explorer/chain/address/coin_balance.ex
  • apps/explorer/lib/explorer/chain/address/counters.ex
  • apps/explorer/lib/explorer/chain/address/reputation.ex
  • apps/explorer/lib/explorer/chain/address/scam_badge_to_address.ex
  • apps/explorer/lib/explorer/chain/advanced_filter.ex
  • apps/explorer/lib/explorer/chain/bridged_token.ex
  • apps/explorer/lib/explorer/chain/cache/background_migrations.ex
  • apps/explorer/lib/explorer/chain/cache/counters/address_counters.ex
  • apps/explorer/lib/explorer/chain/cache/counters/address_counters_consolidator.ex
  • apps/explorer/lib/explorer/chain/cache/counters/address_token_transfers_count.ex
  • apps/explorer/lib/explorer/chain/cache/counters/address_transactions_count.ex
  • apps/explorer/lib/explorer/chain/cache/counters/address_transactions_gas_usage_sum.ex
  • apps/explorer/lib/explorer/chain/cache/counters/consolidation.ex
  • apps/explorer/lib/explorer/chain/cache/counters/gas_usage_sum.ex
  • apps/explorer/lib/explorer/chain/cache/counters/helper.ex
  • apps/explorer/lib/explorer/chain/cache/counters/token_counters.ex
  • apps/explorer/lib/explorer/chain/cache/counters/token_counters_consolidator.ex
  • apps/explorer/lib/explorer/chain/cache/counters/token_holders_count.ex
  • apps/explorer/lib/explorer/chain/cache/counters/token_transfers_count.ex
  • apps/explorer/lib/explorer/chain/cache/propagator.ex
  • apps/explorer/lib/explorer/chain/cache/scam_addresses.ex
  • apps/explorer/lib/explorer/chain/import.ex
  • apps/explorer/lib/explorer/chain/import/runner/address/current_token_balances.ex
  • apps/explorer/lib/explorer/chain/import/runner/blocks.ex
  • apps/explorer/lib/explorer/chain/import/runner/tokens.ex
  • apps/explorer/lib/explorer/chain/internal_transaction.ex
  • apps/explorer/lib/explorer/chain/map_cache.ex
  • apps/explorer/lib/explorer/chain/ordered_cache.ex
  • apps/explorer/lib/explorer/chain/token.ex
  • apps/explorer/lib/explorer/chain/token_transfer.ex
  • apps/explorer/lib/explorer/chain/transaction.ex
  • apps/explorer/lib/explorer/eth_rpc.ex
  • apps/explorer/lib/explorer/etherscan.ex
  • apps/explorer/lib/explorer/etherscan/logs.ex
  • apps/explorer/lib/explorer/market/source/crypto_compare.ex
  • apps/explorer/lib/explorer/migrator/backfill_address_counters.ex
  • apps/explorer/lib/explorer/migrator/backfill_token_counters.ex
  • apps/explorer/lib/explorer/migrator/reindex_blocks_with_uncataloged_token_transfers.ex
  • apps/explorer/lib/explorer/query_helper.ex
  • apps/explorer/lib/explorer/token/metadata_retriever.ex
  • apps/explorer/lib/explorer/utility/address_id_to_address_hash.ex
  • apps/explorer/lib/explorer/utility/counters_refetch_block.ex
  • apps/explorer/mix.exs
  • apps/explorer/priv/repo/migrations/20260831000000_add_counters_updated_at_to_addresses.exs
  • apps/explorer/priv/repo/migrations/20260831000001_create_address_counters_refetch_blocks.exs
  • apps/explorer/priv/repo/migrations/20260831000002_add_counters_updated_at_to_tokens.exs
  • apps/explorer/priv/repo/migrations/20260831000003_rename_address_counters_refetch_blocks.exs
  • apps/explorer/test/explorer/chain/cache/counters/address_counters_consolidator_test.exs
  • apps/explorer/test/explorer/chain/cache/counters/address_counters_test.exs
  • apps/explorer/test/explorer/chain/cache/counters/token_counters_consolidator_test.exs
  • apps/explorer/test/explorer/chain/cache/counters/token_counters_test.exs
  • apps/explorer/test/explorer/chain/cache/propagator_test.exs
  • apps/explorer/test/explorer/chain/cache/scam_addresses_test.exs
  • apps/explorer/test/explorer/chain/cache/transactions_test.exs
  • apps/explorer/test/explorer/chain/import/runner/address/current_token_balances_test.exs
  • apps/explorer/test/explorer/chain/import/runner/blocks_test.exs
  • apps/explorer/test/explorer/chain/token_transfer_test.exs
  • apps/explorer/test/explorer/chain_test.exs
  • apps/explorer/test/explorer/eth_rpc_test.exs
  • apps/explorer/test/explorer/etherscan/logs_test.exs
  • apps/explorer/test/explorer/etherscan_test.exs
  • apps/explorer/test/explorer/market/source/crypto_compare_test.exs
  • apps/explorer/test/explorer/migrator/backfill_address_counters_test.exs
  • apps/explorer/test/explorer/migrator/backfill_token_counters_test.exs
  • apps/explorer/test/explorer/migrator/reindex_blocks_with_uncataloged_token_transfers_test.exs
  • apps/indexer/lib/indexer/block/fetcher.ex
  • apps/indexer/lib/indexer/fetcher/on_demand/internal_transaction.ex
  • apps/indexer/lib/indexer/fetcher/token_counters_updater.ex
  • apps/indexer/lib/indexer/supervisor.ex
  • apps/indexer/lib/indexer/temporary/uncataloged_token_transfers.ex
  • apps/indexer/mix.exs
  • apps/indexer/test/indexer/fetcher/on_demand/contract_creator_test.exs
  • apps/indexer/test/indexer/temporary/uncataloged_token_transfers_test.exs
  • apps/nft_media_handler/mix.exs
  • apps/utils/mix.exs
  • bin/install_chrome_headless.sh
  • config/runtime.exs
  • config/runtime/prod.exs
  • cspell.json
  • docker-compose/envs/common-blockscout.env
  • docker/Makefile
  • mix.exs
  • rel/config.exs

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cursor

cursor Bot commented Sep 10, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_fa223f10-b69a-45f2-b50b-36fd2dd1dc67)

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request implements a major refactoring of the address and token counter systems, introducing incremental consolidation to replace legacy cache modules. Key additions include new cache management modules (AddressCounters, TokenCounters, AddressCountersConsolidator, TokenCountersConsolidator, and Propagator) and several background migrations for backfilling data and reindexing blocks. The PR also includes performance optimizations for transaction preloading and improvements to JSON-RPC batching logic. The review identified two compilation errors: a missing assoc/2 import in apps/explorer/lib/explorer/etherscan/logs.ex and a missing alias for Explorer.QueryHelper in apps/explorer/lib/explorer/chain/import/runner/address/current_token_balances.ex.

Comment on lines +9 to +10
import Ecto.Query,
only: [dynamic: 2, from: 2, join: 5, limit: 2, where: 2, where: 3, subquery: 1, order_by: 3, union_all: 2]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The assoc/2 macro is used in where_consensus/1 (line 142) but is not imported in the Ecto.Query only list at the top of the file. This will cause a compilation error (undefined function assoc/2). Please add assoc: 2 to the imported functions list.

  import Ecto.Query,
    only: [assoc: 2, dynamic: 2, from: 2, join: 5, limit: 2, where: 2, where: 3, subquery: 1, order_by: 3, union_all: 2]


query =
from(ctb in CurrentTokenBalance,
where: ^QueryHelper.tuple_in([:address_hash, :token_contract_address_hash], ids),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The QueryHelper module is referenced here but does not appear to be aliased or imported in this module. To prevent compilation errors, please use the fully qualified name Explorer.QueryHelper.tuple_in or ensure Explorer.QueryHelper is aliased.

        where: ^Explorer.QueryHelper.tuple_in([:address_hash, :token_contract_address_hash], ids),

@JOY
JOY (JOY) force-pushed the sync-upstream-v11.3.0 branch from 9079859 to 183396e Compare September 10, 2026 20:03
@cursor

cursor Bot commented Sep 10, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_fed3ad7c-d98f-4a3f-aab3-3d64bf305039)

@JOY
JOY (JOY) force-pushed the sync-upstream-v11.3.0 branch from 183396e to 36d424c Compare September 11, 2026 02:05
@cursor

cursor Bot commented Sep 11, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_c4d133bc-71d3-4255-9dde-378de9cee6c6)

@JOY
JOY (JOY) force-pushed the sync-upstream-v11.3.0 branch from 36d424c to d0817a9 Compare September 11, 2026 08:04
@cursor

cursor Bot commented Sep 11, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_62f6057b-29f3-4a35-a7b9-ca868252a3a7)

@JOY
JOY (JOY) force-pushed the sync-upstream-v11.3.0 branch from d0817a9 to 4fd18e5 Compare September 11, 2026 14:03
@cursor

cursor Bot commented Sep 11, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_a42bc225-dc86-48d2-8fb5-78107a85d15c)

@JOY
JOY (JOY) force-pushed the sync-upstream-v11.3.0 branch from 4fd18e5 to 4f1535d Compare September 11, 2026 20:03
@cursor

cursor Bot commented Sep 11, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_024e3339-258d-4962-9ab3-4392bc0821b7)

@JOY
JOY (JOY) force-pushed the sync-upstream-v11.3.0 branch from 4f1535d to 5b4feec Compare September 12, 2026 02:05
@cursor

cursor Bot commented Sep 12, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_b19f5b28-e3ca-4418-8a91-f656616ded21)

@JOY
JOY (JOY) force-pushed the sync-upstream-v11.3.0 branch from 5b4feec to ca8562f Compare September 12, 2026 08:04
@cursor

cursor Bot commented Sep 12, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_4d74dc8b-b30e-42c9-a18c-a127c517d687)

@JOY
JOY (JOY) force-pushed the sync-upstream-v11.3.0 branch from ca8562f to 6017d02 Compare September 12, 2026 14:03
@cursor

cursor Bot commented Sep 12, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_e1edd484-2c02-4f74-aefc-6fc831b7fd52)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants